<!doctype html>
<html ng-app>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Player View</title>
    <script src="lib/angular.min.js"></script>
    <script src="js/player.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="bootstrap/css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
    <style>
        UL.effectOffset {
            margin-left: 1em;
        }
        .table td.center {
           text-align: center;
        }
    </style>
</head>
<body>
<div ng-controller="FetchCtrl" ng-init="fetchInitial()" class="">
    <div ng-show="running" style="display: none">
        <div class="navbar navbar-inverse">
            <div class="navbar-inner">
                <a class="brand" style="{ font-size: 12pt; padding: 5px;}" href="#">Player View</a>
                <ul class="nav">
                    <li><a href="/"><i class="icon-arrow-left icon-white"></i> Back</a></li>
                    <li><a ng-click="fetchInitial()" ng-hide="running" style="display: none">
                        <i class="icon-refresh icon-white"></i> Reconnect</a></li>
                </ul>
            </div>
        </div>
        <div class="container" ng-hide="hasData">
            <div class="hero-unit">
                <h2>Waiting...</h2>
                Combat has not started, please wait for you DM to get things started.
            </div>
        </div>
        <div class="container" ng-show="hasData">
            <div class="row">
                <div class="span6">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>Name</th>
                            <th>Health</th>
                            <th>Status</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="entry in data | filter: filterCharacters">
                            <td>{{entry.name}}
                                <ul class="unstyled effectOffset">
                                    <li ng-repeat="effect in entry['effects']">{{effect.description}}
                                        ({{effect.duration}})
                                    </li>
                                </ul>
                            </td>
                            <td>{{entry.health}}</td>
                            <td class="center"><span ng-class="colorStatus(entry.status)">{{entry.status}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="span6">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>Name</th>
                            <th>Status</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="entry in data">
                            <td>{{entry.id}}</td>
                            <td>{{entry.name}}
                                <ul class="unstyled effectOffset">
                                    <li ng-repeat="effect in entry['effects']">{{effect.description}}
                                        ({{effect.duration}})
                                    </li>
                                </ul>
                            </td>
                            <td class="center"><span ng-class="colorStatus(entry.status)">{{entry.status}}</span></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="container" ng-hide="running">
        <div class="hero-unit">
            <h3>Loading...</h3>
            If you are stuck in this screen check the following:
            <ul>
                <li>You have a compatible browser.</li>
                <li>Javascript is enabled.</li>
                <li>VCC Web Server is running.</li>
            </ul>
        </div>
    </div>
</div>
</body>
</html>